﻿Imports System.Data.OleDb
Public Class frmReportesEmpresaPostVentas

    Private Sub frmReportesEmpresaPostVentas_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        DataGridView1.DataSource = Nothing
        crvReportes.Visible = False
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim Da As New OleDbDataAdapter
        Dim Cmd As New OleDbCommand
        Dim Dt As DataTable
        With Cmd
            .CommandType = CommandType.Text
            .CommandText = "SELECT * FROM temporal_empresa_pvta order by temporal_empresa_pvta.auditado DESC "
            .Connection = cadenaConexBD()
        End With

        Da.SelectCommand = Cmd
        Dt = New DataTable
        Da.Fill(Dt)
        DataGridView1.DataSource = Dt

        Dim rpt As New rptEmpresaPosVta
        rpt.SetDataSource(Dt)
        crvReportes.ReportSource = rpt
        crvReportes.Visible = True
        Show()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim limpiarTemporal As New C_querysPostVentas
        limpiarTemporal.eliminarTemporalesPorEmpresa()
        cadenaConexBD.Close()
        Me.Close()
    End Sub
End Class